1. Field of the Invention
This invention relates to the in-circuit emulation of microprocessors, specifically to an improved method of emulating COP8(copyright) microcontrollers.
2. Related Art
It is generally recognized that real-time in-circuit emulators (ICE) are a desirable, and in many cases, a necessary tool for engineers involved in designing applications that use an embedded microprocessor. An ICE allows the engineer to exercise direct control over the execution of his application program being run on the microprocessor. This control enables the engineer to determine if a program is performing as expected, and in the case where it is not, the ICE makes it much easier to debug the program.
An ICE typically has some type of probe that replaces the actual microprocessor on the engineer""s application printed circuit board. Through an interface, usually hosted on a standard Personal Computer, an engineer can use the ICE to view and modify the microprocessor""s internal state, start his program at specific locations, stop his program at specific locations or events or view a snapshot of his program""s execution history.
An ICE is designed around the address and data bus of the microprocessor. It monitors and controls the flow of addresses and data on the microprocessor""s busses and thereby provides the features used by the engineer to control, test and debug a program. However, a special case arises with a class of embedded microprocessors called single chip microcontrollers such as the National Semiconductor COP8 family. There is no address and data bus. These microcontrollers execute their program out of an internal non-volatile code memory such as a ROM, EPROM or Flash.
To provide the advantages of an ICE to their customers, microcontroller manufacturers generally develop a special version of the single chip microcontroller, called a Bond Out chip. A Bond Out chip disables the internal code memory of the single chip microcontroller and brings out the internal address and data bus on extra pins. Using extra pins allows the address and data bus to be available to the ICE while at the same time preserving the chip""s I/O that the user""s application is using. These Bond Out chips are made available to ICE manufacturers so they can develop an ICE for the chip.
While a Bond Out chip allows an ICE to be built for a single chip microcontroller, it nonetheless has several disadvantages. First, because of the extra pins needed, it is packaged in a larger package than the standard production microcontroller. This means that it cannot be used in the site that the production part will occupy on the target system. Rather the Bond Out chip is placed on an ICE Probe or resides in the ICE base unit and the pin signals are connected to the target system through a cable or an adapter. Not operating in the actual application board site causes severe degradation of analog signals and often limits the environmental parameters (e.g., temperature) in which the system can be emulated and debugged.
A second disadvantage of the Bond Out chip is its higher cost, which in some cases can be as high as ten times the cost of the production microcontroller. Several factors contribute to the cost of a Bond Out chip. One is the relatively low volume of the part. While a typical microcontroller in production can run in the millions of units per year, Bond Out chip consumption typically numbers in the tens to hundreds of units per year. Also, cost is added to the Bond Out chip by its use of larger packaging and special test flow due to the extra pins and associated functionality. This results in a more expensive emulator and a higher cost of repair (the most common failure in an ICE system is the Bond Out chip).
A third disadvantage is that over the lifetime of the product, it is not unusual for the Bond Out chip""s operating parameters and functionality to diverge from the production part. The production part is always the focus of improvements through bug fixes, yield improvements and die shrinks. The Bond Out, due to its limited use, often doesn""t share in these improvements. This most commonly happens in cases where the Bond Out is physically a separate die, although it can also happen where the Bond Out is a package option due to limitations on test development resources. When this divergence occurs, the ICE becomes less useful as a real-time emulator.
A fourth disadvantage is that a new Bond Out chip is required when the semiconductor manufacturer decides to add new functionality to a microcontroller by designing and producing new versions of the microcontroller. A new Bond Out is required for each new functional variation. While a new Bond Out chip is not needed if the new variation of the microcontroller is simply less memory or fewer IO pins, it is required whenever new on-chip peripherals or new I/O interfaces are added, or when there are architectural enhancements. This can get particularly burdensome when one considers that usually two to four new, functionally different microcontrollers are introduced every year for common and popular microcontroller architectures.
These different functional variations also impact the ICE manufacturer, since a new ICE Probe has to be designed for each new Bond Out chip. In addition to the development costs involved, it also delays the availability of the ICE for many months while the ICE system with the new Probe is debugged, tested and released to production. This prevents early users of the microcontroller from being able to develop their applications with the aid of an ICE. Since many design engineers will not use a microcontroller unless there is an ICE available for it, this delay can also slow the acceptance of a new microcontroller.
1. An object of one aspect of the invention is to provide circuitry in a modified COPS to allow real-time in-circuit emulation without the need of an address/data bus or Bond Out chip by using the standard production microcontroller.
2. An object of one aspect of the invention is to allow emulation of microcontrollers with integrated high performance analog peripherals without degrading the analog performance.
3. An object of one aspect of the invention is to allow emulation of the COP8 in the actual environment in which it is going to be used without having to xe2x80x9cruggedizexe2x80x9d the emulator to handle hostile conditions.
4. An object of one aspect of the invention is to allow the user""s target system to be easily switched by means of a standard, simple connector between a development system that interfaces to the emulator and a final production system that can be shipped to a customer.
5. An object of one aspect of the invention is to provide circuitry in a modified COP8 to allow a range of emulators.
6. An object of one aspect of the invention is to require a minimal number of modified COP8 pins needed to interface to the emulator to allow for small pin count microcontrollers.
7. An object of one aspect of the invention is not to rely on an external clock as a timing source and be clocking scheme independent.
8. An object of one aspect of the invention is to be able to detect internal Resets so as to allow emulation of COP8 microcontrollers without an external Reset pin.
9. An object of one aspect of the invention is the ability to recreate the COP8 digital pins that interface to the emulator and that these pins can have multiplexed functionality, not just simple digital I/O.
10. An object of one aspect of the invention is to allow the use of on-chip flash memory and allow in-system programming during emulation.
11. An object of one aspect of the invention is to provide for communication between the emulator and an on-chip monitor program to allow full visibility to the state of the microcontroller.
Briefly, the present invention provides a system and method of providing real-time in-circuit emulation of a COP8 microcontroller using the standard production device directly soldered or otherwise connected on the application""s printed circuit board. The system of the present invention, as shown in FIG. 2, contemplates three major blocks. The first block is a flash-memory based microcontroller 201 having a slightly modified COP8 architecture. The second block is the emulator logic, the ICE Logic 202, and the third block is the Control Processor 203 that interfaces between the ICE Logic and the user interface running on a standard Personal Computer.
One embodiment of a method of the present invention uses four digital pins of a flash-memory based COP8 microcontroller that are reconfigured in emulation mode to output clock, status and data to the ICE Logic and an input pin to input commands and data from the ICE Logic. The input pin""s data communicates with a small ROM-based monitor in the COP8 and provides a means of inputting and outputting the internal state of the machine as well as programming the flash memory in-circuit. Those skilled in this field and having the benefit of the present disclosure will understand that although the term xe2x80x9cpinxe2x80x9d is used, the present invention is not limited to use with microcontrollers having pins, but may be used with any type of mechanism by which electrical connection is made to a packaged semiconductor device, including but not limited to solder bumps, solders balls, and lands.
The system and method allow a user sitting at his Personal Computer to use the system as a fully functional, real-time in-circuit emulator. The user will be able to load and patch his program in the on-chip flash of the COP8; run the program or single step through it, set breakpoints; view and change the state of any user-visible memory or register. In addition, optional functions can be added to provide additional debugging capabilities such as code trace and hardware attributes.